import Login from '../page/Login'
import Article from '../page/Article'

import {createBrowserRouter,RouterProvider,createHashRouter} from 'react-router-dom'
import Layout from '../page/Layout'
import Board from '../page/Board'
import About from '../page/About'
import NotFound from '../page/NotFount'

//createBrowserRouter   history模式
//createHashRouter   hash模式
const router = createBrowserRouter([
  {
    path:'/',
    element:<Layout/>,
    children:[
      {
        // path:'board',
        index:true,//默认显示的二级路由，一级路由访问，默认渲染
        element:<Board/>
      },
      {
        path:'about',
        element:<About/>
      },
    ]
  },
  {
    path:'/login',
    element:<Login/>
  },
  {
    path:'/article/:id/:name',
    element:<Article/>
  },
  {
    path:'*',
    element:<NotFound/>
  }
])

export default router